    let href = location.href;
   function getUrlParams(url) {
       let reg = /^[^\s]+\?([^&\s\d]+=[^\s]+)*/
       let match = reg.exec(url)
       match = match[1]
       if (!match) {
           console.warn("没有匹配到相应的query参数")
           return null
       }
       let queryString = decodeURI(match);
       let queryArr = queryString.split("&");
       let queryParamsObj = {}
       queryArr.forEach(item => {
           let itemArr = item.split("=")
           queryParamsObj[itemArr[0]] = itemArr[1]
       })
       return queryParamsObj
   }


   let qr = getUrlParams(href)
   let { productid } = qr;
   
   $.ajax({
       type: "get",
       url: `http://chst.vip:1234/api/getdiscountproduct?productid=${productid}`
   }).then((res) => {
       var arr = res.result;
       let html = '';
       arr.forEach(item =>{
          html += `
           <div class="infoR">
           <div class="title">
               <h4>${item.productName}</h4>
           </div>
           <div class="other">
               <span class="mall f1">${item.productFrom} | ${item.productTime}</span>
               <i>${item.productTips}</i>
               <div>${item.productPrice}</div>
           </div>
           <div class="container">
               <div class="info2">${item.productInfo}</div>
               <p>${item.productImg}</p>
           </div>
            `
       })
       $('#main').html(html);
   })